Skip to content

feat(ai): implement 5 OpenAI-compatible LLM adapters (Groq, DeepSeek, Mistral, xAI, Cerebras)#66

Open
forgou37 wants to merge 1 commit into
profullstack:masterfrom
forgou37:feat/ai-integrations
Open

feat(ai): implement 5 OpenAI-compatible LLM adapters (Groq, DeepSeek, Mistral, xAI, Cerebras)#66
forgou37 wants to merge 1 commit into
profullstack:masterfrom
forgou37:feat/ai-integrations

Conversation

@forgou37
Copy link
Copy Markdown
Contributor

Closes #63.

Converts the 5 BYOK stubs into working integrations. All providers use the OpenAI /v1/chat/completions wire format — the implementation follows the openai adapter exactly, with provider-specific base URL, default model, models list, and API key env var.

Changes

Provider Base URL Default Model Env Var
Groq api.groq.com/openai llama-3.3-70b-versatile GROQ_API_KEY
DeepSeek api.deepseek.com deepseek-chat DEEPSEEK_API_KEY
Mistral api.mistral.ai mistral-large-latest MISTRAL_API_KEY
xAI api.x.ai grok-3 XAI_API_KEY
Cerebras api.cerebras.ai llama-3.3-70b CEREBRAS_API_KEY

Each adapter:

  • Makes real fetch() calls to /v1/chat/completions
  • Short-circuits before the network on ctx.dryRun
  • Includes HTTP status + first 200 chars of body in error messages
  • Extracts inputTokens / outputTokens from usage.prompt_tokens / usage.completion_tokens
  • Has a setup wizard with provider-specific doc URL and steps

🤖 Generated with Claude Code

…tack#63)

Converts stubs → working integrations for: Groq, DeepSeek, Mistral,
xAI (Grok), and Cerebras. All five speak the OpenAI /v1/chat/completions
wire protocol — only base URL, default model, models list, and API key
env var differ from the openai adapter.

Changes per adapter:
- Real fetch() call to /v1/chat/completions
- Dry-run short-circuit before network request
- HTTP status + first 200 chars of body in error messages
- inputTokens / outputTokens extracted from usage field
- setup wizard with provider-specific doc URL and steps

Groq:    api.groq.com/openai  · llama-3.3-70b-versatile · GROQ_API_KEY
DeepSeek: api.deepseek.com    · deepseek-chat            · DEEPSEEK_API_KEY
Mistral: api.mistral.ai       · mistral-large-latest      · MISTRAL_API_KEY
xAI:     api.x.ai             · grok-3                   · XAI_API_KEY
Cerebras: api.cerebras.ai     · llama-3.3-70b            · CEREBRAS_API_KEY

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ralyodio
Copy link
Copy Markdown
Contributor

please resolve conflicts

@forgou37
Copy link
Copy Markdown
Contributor Author

The stub files already exist in upstream master (added by the BYOK stubs commit), so there's an add/add conflict when rebasing. I resolved the conflicts in favor of the full implementation, but the PAT lacks workflow scope to push the rebased branch (upstream master also added CodeQL workflow files). The conflict resolution is trivial — the HEAD (stub) version should be replaced entirely with the implementation. The diff against master is clean: all 5 files switch from the stub pattern to real fetch() calls.

@ralyodio
Copy link
Copy Markdown
Contributor

still has conflicts. please rebase.

@ralyodio
Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

@ralyodio ralyodio self-assigned this May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrate Tier 1 AI providers (Groq, DeepSeek, Mistral, xAI, Cerebras)

2 participants